import pdfplumber

def read_pdf(filepath):
    pdf = pdfplumber.open(filepath)
    page_counts = []
    for page in pdf.pages:
        page_counts.append(page.extract_text())
    pdf.close()
    return " ".join(page_counts)



if __name__ == "__main__":

    filepath = "./file/挪威的森林.pdf"
    res = read_pdf(filepath)
    print(res)
